/* Function to get form data into object */
$.fn.serializeObject = function()
{
    var o = {};
    var a = this.serializeArray();
    $.each(a, function() {
        if (o[this.name] !== undefined) {
            if (!o[this.name].push) {
                o[this.name] = [o[this.name]];
            }
            o[this.name].push(this.value || '');
        } else {
            o[this.name] = this.value || '';
        }
    });
    return o;
};
/* Function to set form data from object */
$.fn.unserializeObject = function(data){
	var frm = $(this);
    $.each(data, function(key, value){
        var ctrl = $('[name='+key+']', frm);
        switch(ctrl.prop("type")){
            case "text" :
            case "hidden":
                ctrl.val(value);
            break;
            case "radio" :
            case "checkbox":
                ctrl.each(function(){
                   if($(this).attr('value') == value) {  $(this).attr("checked",value); }
                });
            break;
        }
    });
}
/* Function for empty text validation */
var fpublic_emptyValidation = function(cell, value){
	if (value == '') { return { result: false, message: "Data wajib diisi" }; }
	return true;
}